import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    // 字符串中找出连续最长的数字串
    public static void main1(String[] args) {
        Scanner input = new Scanner(System.in);
        while(input.hasNext()) {
            String str = input.nextLine();
            char[] chs = str.toCharArray();
            int left = 0;
            int right = 0;
            int len = 0;
            int begin = 0;
            while(right < chs.length){
                if(!(chs[right] >= '1' && chs[right] <= '9')) {
                    while(right < chs.length &&
                            !(chs[right] >= '1' && chs[right] <= '9')) {
                        right++;
                    }
                    left = right;
                }else {
                    while(right < chs.length &&
                            (chs[right] >= '1' && chs[right] <= '9')) {
                        right++;
                    }
                    if(right - left > len) {
                        len = right - left;
                        begin = left;
                    }
                }
            }
            System.out.println(str.substring(begin, begin + len));
        }
    }
    // 数组中出现次数超过一半的数字
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Map<String, Integer> map = new HashMap<>();
        int max = 0;
        String num = "";
        String str = input.nextLine();
        String str2 = str.substring(1, str.length() - 1);
        String[] strs = str2.split(",");
        for(String s : strs) {
            map.put(s, map.getOrDefault(s, 0) + 1);
            if(map.get(s) > max) {
                num = s;
                max = map.get(s);
            }
        }
        System.out.println(num);
    }
    public int MoreThanHalfNum_Solution (int[] numbers) {
        // write code here
        Arrays.sort(numbers);
        return numbers[numbers.length / 2];
    }
}